//
//  RankModel.swift
//  shop
//
//  Created by chen on 2025/5/13.
//

import SwiftUI

struct SalesResp: Codable {
    var itemid: String
    var itempic: String
    var itemprice: String
    var itemendprice: String
    var itemsale: String
    var itemshorttitle: String
    // 店铺类型：天猫（B）淘宝店（C）
    var shoptype: String
    var shopname: String
    var couponinfo: String
    var taobao_image: String
    
    init(itemid: String = "",
         itempic: String = "",
         itemprice: String = "",
         itemendprice: String = "",
         itemsale: String = "",
         itemshorttitle: String = "",
         shoptype: String = "",
         shopname: String = "",
         couponinfo: String = "",
         taobao_image: String = "") {
        
        self.itemid = itemid
        self.itempic = itempic
        self.itemprice = itemprice
        self.itemendprice = itemendprice
        self.itemsale = itemsale
        self.itemshorttitle = itemshorttitle
        self.shoptype = shoptype
        self.shopname = shopname
        self.couponinfo = couponinfo
        self.taobao_image = taobao_image
    }
}

struct RankType: Codable {
    let rankType: Int
    let rankName: String
}


struct RankItem: Codable {
    var id: Int64
    var goodsId: String
    var title: String
    var dtitle: String
    var originalPrice: Double
    var actualPrice: Double
    var shopType: Int
    var shopName: String
    var monthSales: Int64
    var desc: String
    var mainPic: String
    
    init(id: Int64 = 0,
         goodsId: String = "",
         title: String = "",
         dtitle: String = "",
         originalPrice: Double = 0,
         actualPrice: Double = 0,
         shopType: Int = 0,
         shopName: String = "",
         monthSales: Int64 = 0,
         desc: String = "",
         mainPic: String = "") {
        
        self.id = id
        self.goodsId = goodsId
        self.title = title
        self.dtitle = dtitle
        self.originalPrice = originalPrice
        self.actualPrice = actualPrice
        self.shopType = shopType
        self.shopName = shopName
        self.monthSales = monthSales
        self.desc = desc
        self.mainPic = mainPic
    }
}
